Package guiunittest :: Module guitestcase :: Class GUITestCase
[show private | hide private]
[frames | no frames]

Type GUITestCase

object --+    
         |    
  TestCase --+
             |
            GUITestCase


Method Summary
  __init__(self, *args, **kwargs)
  click(self, widget, button, position, state)
Acts as if the given widget was clicked.
  debugHere(self)
Stops the executing of the test at the caller's position, returning control to qt's main loop.
  doubleClick(self, widget, button, position, state)
Sends a double-click event to the given widget.
  executeOnElapsed(self, callback, msecs)
This function schedules the callback to be executed when 'millis' has elapsed
  keyPress(self, widget, key, state)
Sends a key press event to the given widget.
  keyRelease(self, widget, key, state)
Sends a key release event to the given widget.
  mouseDrag(self, widget, pressOn, releaseOn, button, state)
Makes a drag with the mouse.
  mouseMove(self, widget, position, state)
Sends a mouse move event for the given widget.
  mousePress(self, widget, button, position, state)
Sends a press event for the given widget.
  mouseRelease(self, widget, button, position, state)
Sends a mouse release event for the given widget.
  processEvents(self)
Forces Qt to process any events pending in the queue.
  setWidget(self, widget, show, wait)
Must be called in the setUp() method, giving the test widget.
  tearDown(self)
Hook method for deconstructing the test fixture after testing it.
  type(self, widget, key, state)
Acts as if a key was typed in the given widget.
  typeText(self, widget, text)
Types the text over the given widget.
  _convertKey(self, key)
Handles the given key for a KeyEvent.
  _getWidgetCenter(self, widget)
  _keyEvent(self, event_type, widget, key, state)
Sends a key event.
  _mouseEvent(self, event_type, widget, button, position, state)
Sends a MouseEvent with the given event_type.
    Inherited from TestCase
  __call__(self, result)
  __repr__(self)
  __str__(self)
  assert_(self, expr, msg)
Fail the test unless the expression is true.
  assertAlmostEqual(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertAlmostEquals(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertEqual(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  assertEquals(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  assertNotAlmostEqual(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertNotAlmostEquals(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertNotEqual(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  assertNotEquals(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  assertRaises(self, excClass, callableObj, *args, **kwargs)
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs.
  countTestCases(self)
  debug(self)
Run the test without collecting errors in a TestResult
  defaultTestResult(self)
  fail(self, msg)
Fail immediately, with the given message.
  failIf(self, expr, msg)
Fail the test if the expression is true.
  failIfAlmostEqual(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  failIfEqual(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  failUnless(self, expr, msg)
Fail the test unless the expression is true.
  failUnlessAlmostEqual(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  failUnlessEqual(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  failUnlessRaises(self, excClass, callableObj, *args, **kwargs)
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs.
  id(self)
  run(self, result)
  setUp(self)
Hook method for setting up the test fixture before exercising it.
  shortDescription(self)
Returns a one-line description of the test, or None if no description has been provided.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Class Variable Summary
int ALT = 1024                                                                  
int CONTROL = 512                                                                   
int LEFT = 1                                                                     
int MIDDLE = 4                                                                     
int NOBUTTON = 0                                                                     
int RIGHT = 2                                                                     
int SHIFT = 256                                                                   
bool _GUITestCase__qAppInitialized = False

Method Details

click(self, widget, button=None, position=None, state=None)

Acts as if the given widget was clicked. Equivalent to send a mousePress followed by a mouseRelease.

See Also: mousePress for the meaning of the arguments.

debugHere(self)

Stops the executing of the test at the caller's position, returning control to qt's main loop.

Useful to debug the tests.

doubleClick(self, widget, button=None, position=None, state=None)

Sends a double-click event to the given widget.

See Also: mousePress for the meaning of the arguments.

executeOnElapsed(self, callback, msecs)

This function schedules the callback to be executed when 'millis' has elapsed
Parameters:
callback - this is the callable that should be executed.
msecs - milliseconds to call callback.

keyPress(self, widget, key, state=None)

Sends a key press event to the given widget.
Parameters:
key - a qt.Qt.Key_* constant or a one-char string.
state - secondary keys. optional, can be SHIFT, CONTROL, ALT.

keyRelease(self, widget, key, state=None)

Sends a key release event to the given widget.

See Also: keyPress for the meaning of the arguments.

mouseDrag(self, widget, pressOn, releaseOn, button=None, state=None)

Makes a drag with the mouse.
Parameters:
pressOn - this is the position where the mouse is pressed.
releaseOn - this is the position where the mouse is released.

mouseMove(self, widget, position=None, state=None)

Sends a mouse move event for the given widget.

See Also: mousePress for the meaning of the arguments.

mousePress(self, widget, button=None, position=None, state=None)

Sends a press event for the given widget.
Parameters:
button - the pressed mouse button. Can be LEFT, RIGHT or MIDDLE. If not given, LEFT is assumed.
position - a QPoint or a pair, indicating the position in widget coordinates where the button was pressed. If not given, the center of the widget is used.
state - secondary keys. optional, can be SHIFT, CONTROL, ALT.

mouseRelease(self, widget, button=None, position=None, state=None)

Sends a mouse release event for the given widget.

See Also: mousePress for the meaning of the arguments.

processEvents(self)

Forces Qt to process any events pending in the queue.

setWidget(self, widget, show=True, wait=None)

Must be called in the setUp() method, giving the test widget.
Parameters:
show - If show() should be called on the GUI. Set to False if you don't want to see the GUI running.
wait - How long to wait between events, in seconds.

tearDown(self)

Hook method for deconstructing the test fixture after testing it.
Overrides:
unittest.TestCase.tearDown (inherited documentation)

type(self, widget, key, state=None)

Acts as if a key was typed in the given widget. Equivalent to a keyPress followed by a keyRelease.

See Also: keyPress for the meaning of the arguments.

typeText(self, widget, text)

Types the text over the given widget.

_convertKey(self, key)

Handles the given key for a KeyEvent. Returns (key, ascii), where key is one of the qt.Qt.Key_ constants.

If key is a string, it is converted to one of the qt.Qt.Key_* constants.

_keyEvent(self, event_type, widget, key, state=None)

Sends a key event.
Parameters:
key - must be either a qt.Qt.Key_* constant or a one-char string in string.printable.

_mouseEvent(self, event_type, widget, button, position, state)

Sends a MouseEvent with the given event_type.

Class Variable Details

ALT

Type:
int
Value:
1024                                                                  

CONTROL

Type:
int
Value:
512                                                                   

LEFT

Type:
int
Value:
1                                                                     

MIDDLE

Type:
int
Value:
4                                                                     

NOBUTTON

Type:
int
Value:
0                                                                     

RIGHT

Type:
int
Value:
2                                                                     

SHIFT

Type:
int
Value:
256                                                                   

_GUITestCase__qAppInitialized

Type:
bool
Value:
False                                                                  

Generated by Epydoc 2.1 on Wed Nov 24 14:15:09 2004 http://epydoc.sf.net